# This file is released into the public domain.

#!/bin/bash

# clean up generated sitemap files.
rm pages/{micro,}blog.org

# fix absolute links mislabelled as file:// links
for post in $(ls site/posts); do
    sed -i 's/src="file:\/\//src="/g' site/posts/$post
    sed -i 's/href="file:\/\//href="/g' site/posts/$post
done

for page in $(ls site); do
    sed -i 's/src="file:\/\//src="/g' site/$page
    sed -i 's/href="file:\/\//href="/g' site/$page
done

# fix email address.
sed -i 's/xU)U1M2fEQL6bfYGpwSG/\&#104;\&#105;\&#64;\&#121;\&#112;\&#101;\&#105;\&#46;\&#109;\&#101;/' site/index.html
